package com.hbwxz.common.utils;

import com.alibaba.fastjson.JSONObject;

public class JsonUtils {
    public static <T> T readValue(String jsonValue,Class<T> clazz){
        return JSONObject.parseObject(jsonValue, clazz);
    }

    public static String toJsonString(Object object){
        return JSONObject.toJSONString(object);
    }

    public static <T> T readValueFromObject(Object objectValue,Class<T> clazz){
        return JSONObject.parseObject(JSONObject.toJSONString(objectValue), clazz);
    }
}
